Part Number Hot Search : 
MB89475 MBL06S STBK047 1N60P TP120 ZNE1802B IRAE410 TPCC8
Product Description
Full Text Search
 

To Download HTG2150 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  HTG2150 8-bit 320 pixel dot matrix lcd mcu series rev. 1.30 1 may 21, 2002 features  operating voltage: 2.4v~3.6v  16k  16 bits program rom  192  8 bits data ram  8~12 bidirectional i/o lines  8 common  33~40 segment lcd driver  one 16-bit programmable timer with overflow inter - rupts  one 8-bit programmable timer with 8 stage prescaler for pfd  one 8-bit programmable timer with 8 stage prescaler for time base  one 8-bit pwm audio output to directly drive speaker and buzzer  watchdog timer  on-chip rc oscillator for system clock and 32768hz crystal oscillator for timebase and lcd driver  halt function and wake-up feature reduce power consumption  8-level subroutine nesting  bit manipulation instructions  63 powerful instructions  one interrupt input  100-pin qfp package general description the HTG2150 is an 8-bit high performance risc-like microcontroller. the single cycle instruction and two-stage pipeline architecture make it suitable for high speed application. the device is ideally suited for multi - ple lcd low power application among which are calcu - lators, clock timer, game, scales, toys and hand held lcd products, as well as for battery systems.
block diagram HTG2150 rev. 1.30 2 may 21, 2002        
                                                                
                                        !  "        #  #      $ # %   &  '      #    #     #  ( !   #  ( "    !    !   )  *  % (  + " , * -     #  ( .   #  (   #  ( +   #  ( /   #  ( ,   #  ( #  #    * # # ! 0 # %        $ %   *    1      ! 0       .     . 2  3  "        . , 4 5 6 *   $    7 
! 0 
. 8 + 0 8  
0 
,     
     
4     
9  )  *  % (    3  . 8  8    * 8 8 + 0 8  
0 
,     )  *  % ( 4 :           7   4 :           7   4 :           7   3    # 3   #  " 3   #  .  )  *  % ( 3   #  " 3   #  . 3    3   *      7   3   *   *     . / ,
pin assignment HTG2150 rev. 1.30 3 may 21, 2002 " . + / , 4 9 " ! " " " . " " + " / " , " " 4 " 9 . ! . " . . . . + . / . , . . 4 . 9 ! " . + / , 4 9 + ! + " + . + + + + / + , + + 4 + 9 / ! 4 " 4 . 4 4 + 4 / 4 , 4 4 4 4 9 9 ! 9 " 9 . 9 9 + 9 / 9 , 9 9 4 9 9 " ! ! 4 ! 9 4 , / + . " ! , 9 , 4 , , , , / , + , , . , " , ! / 9 / 4 / / , / / / + / / . / "                 
. / 
. , 
. 
. 4 
. 9 
! 
" 
. 8 +  
8 /  
+ 8 ,  
/ 8  
,     
     
4     
9                       # # , # / # + # # . # " # !           3  . 3  "                     
4 

, 
/ 
+ 

. 
" 
!       ,    /    +       .    "    !                   
9 
" ! 
" " 
" . 
" 
" + 
" / 
" , 
" 
" 4 
" 9 
. ! 
. " 
. . 
. 
. +                

pad assignment * the ic substrate should be connected to vss in the pcb layout artwork. pad coordinates unit:  m pad no. x y pad no. x y 1  880.45 1114.46 32 882.36  639.47 2  887.11 872.13 33 882.36  532.87 3  887.11 765.63 34 882.36  426.37 4  887.11 659.03 35 882.36  319.77 5  887.11 552.53 36 882.36  213.27 6  887.11 445.93 37 882.36  106.67 7  887.11 339.43 38 882.36  0.17 8  887.11 232.83 39 882.36 106.43 9  822.70 103.48 40 882.36 212.93 10  822.70  13.52 41 882.36 319.53 11  822.70  127.52 42 882.36 426.03 12  822.70  244.52 43 882.36 532.63 HTG2150 rev. 1.30 4 may 21, 2002 " . . + + / / , , 4 4 9 9 + ! " ! + " " " + . " . + " + + " + + / " / + , " , + " + 4 " 4 + 9 " 9 / ! . ! / " . " / . . . / . / + . + / / . / / , . , / . / 4 . 4 / 9 . 9 , ! ! , " " , . ; ! < ! = 
. / 
. , 
. 
. 4 
. 9 
! 
" 
. 8 +  
8 /  
+ 8 ,  
/ 8  
,      
4     
9   3  " 3  .           # ! # " # . # # + # / # , #    !    "    .       +    /    ,    

. 
" 
! 
+ 

, 
/ 
4 
9 
" ! 
" " 
" . 
" 
" + 
" / 
" , 
" 
" 4 
" 9 
. ! 
. " 
. . 
. 
. +     

pad no. x y pad no. x y 13  824.04  354.49 44 882.36 639.13 14  824.04  462.62 45 882.36 745.73 15  823.97  580.52 46 882.36 852.23 16  871.13  1052.80 47 824.35 1114.46 17  720.90  1052.80 48 717.85 1114.46 18  539.25  1052.80 49 611.25 1114.46 19  404.50  1051.65 50 504.75 1114.46 20  273.79  1032.67 51 398.15 1114.46 21  99.06  1097.34 52 291.65 1114.46 22 58.61  1057.70 53 185.05 1114.46 23 175.41  1057.70 54 78.55 1114.46 24 289.41  1057.70 55  28.05 1114.46 25 406.21  1057.70 56  134.55 1114.46 26 520.21  1057.70 57  241.15 1114.46 27 637.01  1057.70 58  347.65 1114.46 28 751.01  1057.70 59  454.25 1114.46 29 867.81  1057.70 60  560.75 1114.46 30 882.36  852.57 61  667.35 1114.46 31 882.36  745.97 62  773.85 1114.46 pad description pad no. pad name i/o mask option description 38~62 1~8 seg0~seg24 seg25~seg32 o  lcd segment signal output. 9~12 pb4~pb7/ seg33~seg36 i/o or o input/output or segment output selectable as bidirectional input/output or lcd segment signal out- put by mask option. on bidirectional input/output port. software in- structions determine the cmos output or schmitt trigger input with pull-high resistor. pb4~pb7 share pad with seg33~seg36. 13 int /seg37 i or o interrupt input or segment 37 output selectable as external interrupt schmitt trigger input or lcd seg- ment 37 signal output by mask option. external interrupt schmitt trigger input with pull-high resistor. edge triggered activated on a high to low transition. int shares pad with seg37. 15 14 xin/seg39 xout/seg38 ioro o crystal or segment output selectable as 32768hz crystal oscillator or lcd segment signal output by mask option. crystal oscillator (32.768khz) for timer 3 and lcd clock. xin shares pad with seg39; xout shares pad with seg38. 16 res i  schmitt trigger reset input. active low without pull-high resistor. 17 pwm1 o cmos positive pwm cmos output 18 pwm2 o cmos negative pwm cmos output 19 vdd  positive power supply 20 osci i  osci is connected to the rc network of the internal system clock. 21 vss  negative power supply, ground 22~29 pa0~pa7 i/o wake-up or none wake-up bidirectional 8-bit input/output port. each bit can be configured as a wake-up input by mask option. software instructions deter - mine the cmos output or schmitt trigger input with pull-high re - sistor. 37~31 com7~com0 o  lcd common signal output HTG2150 rev. 1.30 5 may 21, 2002
absolute maximum ratings supply voltage .........................................  0.3v to 3.6v storage temperature ............................  50  cto125  c input voltage..............................v ss  0.3v to v dd +0.3v operating temperature...............................0  cto70  c note: these are stress ratings only. stresses exceeding the range specified under  absolute maximum ratings  may cause substantial damage to the device. functional operation of this device at other conditions beyond those listed in the specification is not implied and prolonged exposure to extreme conditions may affect device reliabil - ity. d.c. characteristics ta=25  c symbol parameter test conditions min. typ. max. unit v dd conditions v dd operating voltage  2.4  3.6 v i dd operating current (rc osc) 3v no load, f sys =4mhz  12ma i stb1 standby current with 7  a lcd bias option (rtc on, lcd on) 3v no load, halt mode  20  a i stb2 standby current lcd bias off option (rtc off, lcd off) 3v no load, halt mode  0.5 1.5  a v il1 input low voltage for pa/pb 3v  0  0.9 v v ih1 input high voltage for pa/pb 3v  2.1  3v v il2 input low voltage (int )3v  0  0.7 v v ih2 input high voltage (int )3v  2.3  3v v il3 input low voltage (res )3v  1.5  v v ih3 input high voltage (res )3v  2.4  v i oh1 port a, port b source current 3v v oh =2.7v  1  2  ma i oh2 segment, common output source current 3v v oh =2.7v 100 200  a i oh3 pwm1/pwm2 source current 3v v oh =2.7v  6  8  ma i ol1 port a, port b sink current 3v v ol =0.3v 1.5 4  ma i ol2 segment, common output sink current 3v v ol =0.3v 250 500  a i ol3 pwm1/pwm2 sink current 3v v oh =0.3v 810  ma r ph pull-high resistance of pa/pb and int 3v  30 60 120 k  a.c. characteristics ta=25  c symbol parameter test conditions min. typ. max. unit v dd conditions f sys system clock (rc osc) 3v  400  4000 khz 2.4v  400  4000 t res external reset low pulse width  1  s t sst system start-up timer period  power-up or wake-up from halt  1024  t sys t int interrupt pulse width  1  s note: t sys =1/f sys HTG2150 rev. 1.30 6 may 21, 2002
HTG2150 rev. 1.30 7 may 21, 2002  "  .   +  "  .   +  "  .   + 2    & *     * ;  = >      *     * ;  : " = 2    & *     * ;  ? " = >      *     * ;  = 2    & *     * ;  ? . = >      *     * ;  ? " =   ? "  ? .  $      7   @  8   @ ! 8   @ " 4 " 9 .  " , 8        @ * 8   @ *               * 8   / *    * #       # " * -   * %    & %    & *     *   * >        *  ' * a   *   *   7 7 *            " , ( *       *    * #          * #   &         " * -                 ! ! ! ! 5 " 2 2 2 5 . ! ! ! 5 2 2 2 5 execution flow functional description execution flow the system clock for the HTG2150 is derived from an rc oscillator. the system clock is internally divided into four non-overlapping clocks. one instruction cycle con - sists of four system clock cycles. instruction fetching and execution are pipelined in such a way that a fetch takes one instruction cycle while de - coding and execution takes the next instruction cycle. however, the pipelining scheme causes each instruc - tion to effectively execute in one cycle. if an instruction changes the program counter, two cycles are required to complete the instruction. program counter  pc the 13-bit program counter (pc) controls the sequence in which the instructions stored in the program rom are executed and its contents specify a maximum of 8192 addresses. after accessing a program memory word to fetch an in - struction code, the contents of the program counter are incremented by one. the program counter then points to the memory word containing the next instruction code. when executing a jump instruction, conditional skip ex - ecution, loading pcl register, subroutine call, initial re - set, internal interrupt, external interrupt or return from subroutine, the pc manipulates the program transfer by loading the address corresponding to each instruction. the conditional skip is activated by instruction. once the condition is met, the next instruction, fetched during the current instruction execution, is discarded and a dummy cycle replaces it to get the proper instruction. otherwise proceed with the next instruction. the lower byte of the program counter (pcl) is a read - able and writeable register (06h). moving data into the pcl performs a short jump. the destination will be within 256 locations. when a control transfer takes place, an additional dummy cycle is required. mode program rom address *13 *12 *11 *10 *9 *8 *7 *6 *5 *4 *3 *2 *1 *0 initial reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 external interrupt 0 0 0 0 0 0 0 0 0 0 0 1 0 0 timer counter 0 overflow 0 0 0 0 0 0 0 0 0 0 1 0 0 0 timer 2 overflow 0 0 0 0 0 0 0 0 0 1 0 0 0 0 timer 3 overflow 0 0 0 0 0 0 0 0 0 1 0 1 0 0 d/a buffer empty interrupt 0 0 0 0 0 0 0 0 0 1 1 0 0 0 skip pc+2 loading pcl *13 *12 *11 *10 *9 *8 @7 @6 @5 @4 @3 @2 @1 @0 jump, call branch bp.5 #12 #11 #10 #9 #8 #7 #6 #5 #4 #3 #2 #1 #0 return from subroutine s13 s12 s11 s10 s9 s8 s7 s6 s5 s4 s3 s2 s1 s0 program rom address note: *13~*0: program rom address s13~s0: stack register bits @7~@0: pcl bits bp.5: bit 5 of bank pointer (04h) #12~#0: instruction code bits
HTG2150 rev. 1.30 8 may 21, 2002 program memory  rom the program memory, which contains executable pro - gram instructions, data and table information, is com - posed of a 16384 x 16 bit format. however as the pc (program counter) is comprised of only 13 bits, the re - maining 1 rom address bit is managed by dividing the program memory into 2 banks, each bank having a range between 0000h and 1fffh. to move from the present rom bank to a different rom bank, the higher 1 bit of the rom address are set by the bp (bank pointer), while the remaining 13 bits of the pc are set in the usual way by executing the appropriate jump or call instruc - tion. as the full 14 address bits are latched during the execution of a call or jump instruction, the correct value of the bp must first be setup before a jump or call is exe - cuted. when either a software or hardware interrupt is received, note that no matter which rom bank the pro - gram is in the program will always jump to the appropri - ate interrupt service address in bank 0. the original full 14 bit address will be stored on the stack and restored when the relevant ret/reti instruction is executed, automatically returning the program to the original rom bank. this eliminates the need for programmers to man - age the bp when interrupts occur. certain locations in bank 0 of program memory are re - served for special usage:  rom bank 0 (bp5~bp7=000b) the rom bank 0 ranges from 0000h to 1fffh.  location 000h this area is reserved for the initialization program. af - ter chip reset, the program always begins execution at location 000h.  location 004h this area is reserved for the external interrupt service program. if the int input pin is activated, and the inter - rupt is enabled and the stack is not full, the program begins execution at location 004h.  location 008h this area is reserved for the timer counter 0 interrupt service program. if a timer interrupt results from a timer counter 0 overflow, and if the interrupt is enabled and the stack is not full, the program begins execution at lo - cation 008h.  location 010h/014h this area is reserved for the timer 2/3 interrupt service program. if a timer interrupt results from a timer 2/3 over - flow, and if the interrupt is enabled and the stack is not full, the program begins execution at location 010h/014h.  location 018h this area is reserved for the d/a buffer empty inter - rupt service program. after the system latch a d/a code at ram address 28h, the interrupt is enable, and the stack is not full, the program begins execution at location 018h.  location 020h for best condition, this is the starting location for writ- ing the program..  rom bank 1 (bp5~bp7=001b) the range of the rom starts from 2000h to 3fffh.  table location any location in the rom space can be used as look up tables. the instructions tabrdc [m] (use for any bank) and tabrdl [m] (only used for last page of pro - gram rom) transfers the contents of the lower-order byte to the specified data memory, and the higher-order byte to tblh (08h). only the destination of the lower-order byte in the table is well-defined. the higher-order byte of the table word are transferred to the tblh. the table higher-order byte register (tblh) is read only. the table pointer (tbhp, tblp) is a read/write register (1fh, 07h), which indicates the ta - ble location. before accessing the table, the location ! ! ! ! 5 ! ! ! + 5 ! ! ! 4 5   1    *       7  6      *       >      7 *         *   -             *        * ! *         *   -                 " , * -    2 2 2 5 ! ! !  5      * . *         *   -             * *         *   -        ! " ! 5 ! " + 5   # * -  ' '   *    $ *         ! " 4 5       program memory instruction(s) table location *13 *12 *11 *10 *9 *8 *7 *6 *5 *4 *3 *2 *1 *0 tabrdc [m] #5 #4 #3 #2 #1 #0 @7 @6 @5 @4 @3 @2 @1 @0 tabrdl [m] 1 1 1 1 1 1 @7 @6 @5 @4 @3 @2 @1 @0 table location note: @7~@0: tblp register bit 7~bit 0 *13~*0: current program rom table address bit 13~bit 0 #5~#0: tbhp register bit 13~bit 8
HTG2150 rev. 1.30 9 may 21, 2002 must be placed in tblp. the tblh is read only and cannot be restored. if the main routine and the isr (interrupt service routine) both employ the table read instruction, the contents of the tblh in the main rou - tine are likely to be changed by the table read instruc - tion used in the isr. errors can occur. in other words, using the table read instruction in the main routine and the isr simultaneously should be avoided. however, if the table read instruction has to be applied in both the main routine and the isr, the interrupt is sup - posed to be disabled prior to the table read instruction. it will not be enabled until the tblh has been backed up. all table related instructions need two cycles to complete the operation. these areas may function as normal program memory depending upon the require - ments. stack register  stack this is a special part of the memory which is used to save the contents of the program counter (pc) only. the stack is organized into eight levels and is neither part of the data nor part of the program space, and is neither readable nor writeable. the activated level is indexed by the stack pointer (sp) and is neither readable nor writeable. at a subroutine call or interrupt acknowledg - ment, the contents of the program counter and rom ad - dress a13 bit latch data are pushed onto the stack. at the end of a subroutine or an interrupt routine, signaled by a return instruction (ret or reti), the program coun- ter and rom address a13 bit latch data are restored to its previous value from the stack. after a chip reset, the sp will point to the top of the stack. if the stack is full and a non-masked interrupt takes place, the interrupt request flag will be recorded but the acknowl- edgment will be inhibited. when the stack pointer is decre- mented (by ret or reti), the interrupt will be serviced. this feature prevents stack overflow allowing the pro - grammer to use the structure more easily. in a similar case, if the stack is full and a call is subsequently exe - cuted, stack overflow occurs and the first entry will be lost (only the most recent eight return address are stored). data memory  ram  bank 0 (bp4~bp0=00000) the bank 0 data memory includes special purpose and general purpose memory. the special purpose memory is addressed from 00h to 2fh, while general purpose memory is addressed from 40h to ffh. all data memory areas can handle arithmetic, logic, in - crement, decrement and rotate operations directly. except for some dedicated bits, each bit in the data memory can be set and reset by the set [m].i and clr [m].i instructions, respectively. they are also indi - rectly accessible through the memory pointer registers (mp0;01h, mp1;03h).  bank 15 (bp4~bp0=01111b) the range of ram starts from 80h to a7h. on the lcd, every bit stands for one dot. if the bit is  1  , the light of the dot on the lcd will be turned on. if the bit is  0  , then it will be turned off. only mp1 can deal with the memory of this range. the contrast form of ram location, common, and segment is as follows. indirect addressing register location 00h and 02h are indirect addressing registers that are not physically implemented. any read/write opera - tion of [00h] and [02h] access data memory are pointed to by mp0 (01h) and mp1 (03h) respectively. reading loca - tion 00h or 02h indirectly will return the result 00h. writing indirectly results in no operation. 2 5 2 2 5    .    .      5  8 5        3   3       b  # %  + ! 5 "  5 " 5 " 2 5 . ! 5 . " 5 . . 5 . 5 . + 5 . / 5 . , 5 . 5 . 4 5 . 9 5 . # 5 . 8 5 .  5 .  5 . 5 . 2 5 ! 5 %    %   *       7 *               *   * #       *            *   * c ! ! c 8 * -   *  .  "  ! *     d ! e *       4 ! 5 # 5 8   @ * " / *     *      $ ; + ! * 8 $   =
     7 *      8   @ * ! *     *      $ ; " 9 . * 8 $   = ! ! 5 ! " 5 ! . 5 ! 5 ! + 5 ! / 5 ! , 5 ! 5 ! 4 5 ! 9 5 ! # 5 ! 8 5 !  5 !  5 ! 5 ! 2 5 " ! 5 " " 5 " . 5 " 5 " + 5 " / 5 " , 5 " 5 " 4 5 " 9 5 " # 5 " 8 5 "  5  #  !  !  #  "  " 8 #    %  8 %  8 % 5 3      #           ! 5    ! %    !  # #  8 8  # *    *     *         # *    *       7 *         8 *    *     *         8 *    *       7 *                 * #          *         * !      $ *       * !         * #          *         * "      $ *       * " 8   @ *       #      7           *        * %  f   : - $   *           - 7  *       * %  f   :      * 8 $   *           - 7  * 5   &   :      * 8 $   *         3    &    *      *      *        *               *                 *       7 *              *        * ! * 5   &   :      * 8 $   *              *        * ! * %  f   :      * 8 $   *              *        * ! *       7 *              7 *          *      $         *       7 * 5   &   :      * 8 $   *           - 7  *       * 5   &   :      * 8 $   *              * . *              * . *       7 *              * *              * *       7 *          b   7 * 2    *     7 7     *  *       7 3  *       7 3  *     ram mapping
HTG2150 rev. 1.30 10 may 21, 2002 the function of data movement between two indirect ad - dressing registers, is not supported. the memory pointer registers, mp0 and mp1, are 8-bit registers which can be used to access the data memory by com - bining corresponding indirect addressing registers but bank 15 can use mp1 only. accumulator the accumulator is closely related to alu operations. it is also mapped to location 05h of the data memory and it can carry out immediate data operations. the data movement between two data memories has to pass through the accumulator. lcd driver output the maximum output number of the HTG2150 lcd driver is 8  40. the lcd driver bias type is  r  type, no external capacitor is required and the bias voltage is 1/4 bias. some of the segment outputs share pins with another pins, pb4~pb7 (seg33~seg36), int (seg37), xout (seg38), xin (seg39). whether segment output or i/o pin can individually be decided by mask option. lcd driver output can be enabled or disabled by setting the lcd (bit 6 of lcdc; 2eh) without the influence of the related memory condition. there is a special function for lcd display, which is rotate function. there are 8 kinds of rotate function, (user can change the data of the ss0 to ss3.) an example of an lcd driving waveform (1/8 duty, 1/4 bias) is shown below. " . + / , 4 / " . 5 6    !     + *    .  + *    "  + *   
     "     + *    .  + *    "  + *   
  
!     + *    .  + *    "  + *   
  . 5 6 " . + / " . + / , 4 #          !    "    .       +    /    ,    4 ! 5 8   ! 8   " 8   . 8   8   + 8   / 8   , 8   
! 4 " 5 
" 4 . 5 
. 4 5 
4 + 5 4 / 5 9 " 5 
/ 
" 
+ 9 . 5 
" 4 
9 # 5                            !
HTG2150 rev. 1.30 11 may 21, 2002 arithmetic and logic unit  alu this circuit performs 8-bit arithmetic and logic operation. the alu provides the following functions:  arithmetic operations (add, adc, sub, sbc, daa)  logic operations (and, or, xor, cpl)  rotation (rl, rr, rlc, rrc)  increment and decrement (inc, dec)  branch decision (sz, snz, siz, sdz ....) the alu not only saves the results of a data operation but also changes the status register. status register  status this 8-bit register (0ah) contains the zero flag (z), carry flag (c), auxiliary carry flag (ac), overflow flag (ov), power down flag (pd) and watchdog time-out flag (to). it also records the status information and controls the oper - ation sequence. with the exception of the to and pd flags, bits in the status register can be altered by instructions like any other register. any data written into the status register will not change the to or pd flags. in addition it should be noted that operations related to the status register may give different results from those intended. the to and pd flags can only be changed by system power up, watchdog timer overflow, executing the halt instruc - tion and clearing the watchdog timer. the z, ov, ac and c flags generally reflect the status of the latest operations. in addition, on entering the interrupt sequence or exe - cuting the subroutine call, the status register will not be automatically pushed onto the stack. if the contents of status are important and if the subroutine can corrupt the status register, precautions must be taken to save it properly. register bit no. label function lcdc 0~5  can r/w (default 000000b) 6 lcd control the lcd output (0=disable; 1=enabled) (default=1) 7rc lcd clock source select (default=0) 1= 32768hz crystal 0= system clock (note*) lcdc register note: * when the mask option is selected to 32k x tal disable, user should set  0  to lcdc.7 but the 32k x tal can t be disabled in the ht-ide2000 tools, so user should take care of this difference. rotate description ssl3 ssl2 ssl1 ssl0 x000 the pad of common 0 is connected to common 0 and the pad of common 1 is con - nected to common 1 and so on. x001 the pad of common 0 is connected to common 1 and the pad of common 1 is con - nected to common 2 and so on. x010 the pad of common 0 is connected to common 2 and the pad of common 1 is con - nected to common 3 and so on. x011 the pad of common 0 is connected to common 3 and the pad of common 1 is con - nected to common 4 and so on. x100 the pad of common 0 is connected to common 4 and the pad of common 1 is con - nected to common 5 and so on. x101 the pad of common 0 is connected to common 5 and the pad of common 1 is con- nected to common 6 and so on. x110 the pad of common 0 is connected to common 6 and the pad of common 1 is con- nected to common 7 and so on. x111 the pad of common 0 is connected to common 7 and the pad of common 1 is con- nected to common 0 and so on. 2fh register
HTG2150 rev. 1.30 12 may 21, 2002 interrupt the HTG2150 provides an external interrupt and a pwm d/a interrupt and internal timer interrupts. the in - terrupt control register (intc;0bh, intch;1eh) con - tains the interrupt control bits to set the enable/disable and the interrupt request flags. once an interrupt subroutine is serviced, all other inter - rupts will be blocked (by clearing the emi bit). this scheme may prevent any further interrupt nesting. other interrupt requests may happen during this interval but only the interrupt request flag is recorded. if a certain in- terrupt needs servicing within the service routine, the programmer may set the emi bit and the corresponding bit of the intc to allow interrupt nesting. if the stack is full, the interrupt request will not be acknowledged, even if the related interrupt is enabled, until the sp is decre- mented. if immediate service is desired, the stack must be prevented from becoming full. all these kinds of interrupt have a wake-up capability. as an interrupt is serviced, a control transfer occurs by pushing the program counter and a13 bit onto the stack followed by a branch to subroutines at specified loca - tions in the program memory. only the program counter and a13 bit are pushed onto the stack. if the contents of the register and status register (status) are altered by the interrupt service program which corrupt the desired control sequence, the contents should be saved first. external interrupt is triggered by a high to low transition of int and the related interrupt request flag (eif; bit 4 of intc) will be set. when the interrupt is enabled, and the stack is not full and the external interrupt is active, a sub - routine call to location 04h will occur. the interrupt re - quest flag (eif) and emi bits will be cleared to disable other interrupts. the internal timer counter 0 interrupt is initialized by set- ting the timer counter 0 interrupt request flag (t0f; bit 5 of intc), resulting from a timer 0 overflow. when the in- terrupt is enabled, and the stack is not full and the t0f bit is set, a subroutine call to location 08h will occur. the related interrupt request flag (t0f) will be reset and the emi bit cleared to disable further interrupts. the timer 2/3 interrupts are operated in the same man - ner as timer 0. while et2i/et3i and t2f/t3f are the re - lated control bits and the related request flags of tmr2/tmr3, which locate at bit0/bit1 and bit4/bi5 of the intch respectively. during the execution of an interrupt subroutine, other inter - rupt acknowledgments are held until the reti instruction is executed or the emi bit and the related interrupt control bit aresetto1(ifthe stack is not full). to return from the inter - labels bits function c0 c is set if the operation results in a carry during an addition operation or if a borrow does not take place during a subtraction operation; otherwise c is cleared. c is also affected by a rotate through carry instruction. ac 1 ac is set if the operation results in a carry out of the low nibbles in addition or no borrow from the high nibble into the low nibble in subtraction; otherwise ac is cleared. z 2 z is set if the result of an arithmetic or logic operation is zero; otherwise z is cleared. ov 3 ov is set if the operation results in a carry into the highest-order bit but not a carry out of the highest-order bit, or vice versa; otherwise ov is cleared. pd 4 pd is cleared when either a system powers up or a clr wdt instruction is executed. pd is set by executing the halt instruction. to 5 to is cleared by a system power-up or executing the clr wdt or halt instruction. to is set by a wdt time-out.  6, 7 unused bit, read as  0  . status register register bit no. label function intc 0 emi controls the (global) interrupt (1=enable; 0=disable) 1 eei controls the external interrupt (1=enable; 0=disable) 2 et0i controls the timer counter 0 interrupt (1=enable; 0=disable) 3  unused bit 4 eif external interrupt request flag (1=active; 0=inactive) 5 t0f internal timer counter 0 request flag (1=active; 0=inactive) 6, 7  unused bit intc register
HTG2150 rev. 1.30 13 may 21, 2002 rupt subroutine, the ret or reti instruction may be in - voked. reti will set the emi bit to enable an interrupt service, but ret will not. interrupts occurring in the interval between the rising edges of two consecutive t2 pulses, will be serviced on the latter of the two t2 pulses, if the corresponding inter - rupts are enabled. in the case of simultaneous requests the priorities applied are shown in the following table. these can be masked by resetting the emi bit. no. interrupt source priority vector a external interrupt 1 04h b timer counter 0 overflow 2 08h d timer 2 overflow 4 10h e timer 3 overflow 5 14h f pwm d/a interrupt 6 18h the timer counter 0 and timer 2/3 interrupt request flag (t0f/t2f/t3f), external interrupt request flag (eif), pwm d/a interrupt request flag (pwmf),enable timer 0/2/3 bit (et0i/et2i/et3i), enable pwm d/a interrupt (pwmi), en - able external interrupt bit (eei) and enable master interrupt bit (emi) constitute an interrupt control register (intc/intch) which is located at 0bh/1eh in the data memory. emi, eei, et0i, et2i, et3i, pwmi are used to control the enabling/disabling of interrupts. these bits prevent the requested interrupt from being serviced. once the interrupt request flags (t0f, t2f, t3f, eif, pwmf) are set, they will remain in the intc/intch reg - ister until the interrupts are serviced or cleared by a soft - ware instruction. it is recommended that a program does not use the  call subroutine  within the interrupt subroutine. inter - rupts often occur in an unpredictable manner or need to be serviced immediately in some applications. if only one stack is left and enabling the interrupt is not well controlled, the  call subroutine  should not operate in the interrupt subroutine as it will damage the original control seque nce. oscillator configuration there are two oscillator circuits in the HTG2150. the rc oscillator signal provides the internal system clock. the halt mode stops the system oscillator and ignores any external signal to conserve power. only the rc oscillator is designed to drive the internal system clock. the rtc oscillator provides the timer 3 and lcd driver clock source. the rc oscillator needs an external resistor connected between osci and vss. the resistance value must range from 50k  to 400k  . however, the frequency of the oscillation may vary with v dd , temperature and the chip itself due to process varia - tions. it is, therefore, not suitable for timing sensitive oper - ations where accurate oscillator frequency is desired. there is another oscillator circuit designed for the real time clock. in this case, only the 32768hz crystal can be applied. the crystal should be connected between xin and xout, and two external capacitors are required for the oscillator circuit in order to get a stable frequency. the rtc oscillator is used to provide clock source for the lcd driver and timer 3. it can be enabled or dis - abled by mask option. the wdt oscillator is a free running on-chip rc oscilla - tor, requiring no external components. even if the sys - tem enters the power down mode, and the system clock is stopped, the wdt oscillator still runs with a period of approximately 78  s. the wdt oscillator can be dis - abled by mask option to conserve power. register bit no. label function intch 0 et2i controls the timer 2 interrupt (1=enable; 0=disable) 1 et3i controls the timer 3 interrupt (1=enable; 0=disable) 2 pwmi pwm d/a interrupt (1=enable; 0=disable) 3  should be set as  0  always 4 t2f internal timer 2 request flag (1=active; 0=inactive) 5 t3f internal timer 3 request flag (1=active; 0=inactive) 6 pwmf pwm d/a flag (1=active; 0=inactive) 7  should be set as  0  always intch register        *     7 7            . , 4 5 6   *     7 7     system and rtc oscillator
HTG2150 rev. 1.30 14 may 21, 2002 watchdog timer  wdt the wdt clock source is implemented by a dedicated rc oscillator (wdt oscillator). this timer is designed to pre - vent a software malfunction or sequence jumping to an un - known location with unpredictable results. the watchdog timer can be disabled by mask option. if the watchdog timer is disabled, all the executions related to wdt result in no operation. when the internal wdt oscillator (rc oscillator with 78  s period normally) is enable, it is first divided by 256 (8 stages) to get the nominal time-out period of approxi - mately 20ms. this time-out period may vary with tem - perature, v dd and process variations. by invoking the wdt prescaler, longer time-out periods can be realized. writing data to ws2, ws1, ws0 (bits 2,1,0 of the wdts) can give different time-out periods. if ws2, ws1, ws0 are all equal to 1, the division ratio is up to 1:128, and the maximum time-out period is 2.6 seconds. ws2 ws1 ws0 division ratio 000 1:1 001 1:2 010 1:4 011 1:8 1 0 0 1:16 1 0 1 1:32 1 1 0 1:64 1 1 1 1:128 wdts register the wdt overflow under normal operation will initialize  chip reset  and set the status bit to. whereas in the halt mode, the overflow will initialize a  warm reset  only the pc and sp are reset to zero. to clear the wdt contents (including the wdt prescaler), three methods are adopted; external reset (a low level to res ), soft - ware instructions, or a halt instruction. the software in - struction is  clr wdt  , execution of the clr wdt instruction will clear the wdt. power down operation  halt the halt mode is initialized by the halt instruction and results in the following...  the system oscillator will turn off but the wdt oscilla - tor keeps running (if the wdt oscillator is selected).  the contents of the on-chip ram and registers remain unchanged.  wdt and wdt prescaler will be cleared and do re - counting again.  all i/o ports maintain their original status.  the pd flag is set and the to flag is cleared. the system can leave the halt mode by means of an external reset, an interrupt, an external falling edge sig - nal on port a or a wdt overflow. an external reset causes a device initialization and the wdt overflow per - forms a  warm reset  . by examining the to and pd flags, the reason for chip reset can be determined. the pd flag is cleared when the system powers up or upon executing the clr wdt instruction and is set when the halt in - struction is executed. the to flag is set if the wdt time-out occurs, and causes a wake-up that only resets the pc and sp, the others maintain their original status. the port a wake-up and interrupt methods can be con - sidered as a continuation of normal execution. each bit in port a can be independently selected to wake up the device by mask option. awakening from an i/o port stim - ulus, the program will resume execution of the next in - struction. if awakening from an interrupt, two sequences may happen. if the related interrupt is disabled or the in- terrupt is enabled but the stack is full, the program will resume execution at the next instruction. if the interrupt is enabled and the stack is not full, the regular interrupt response takes place. once a wake-up event occurs, it takes 1024 t sys (sys- tem clock period) to resume normal operation. in other words, a dummy cycle period will be inserted after the wake-up. if the wake-up results from an interrupt ac- knowledge, the actual interrupt subroutine will be de - layed by one more cycle. if the wake-up results in the next instruction execution, this will be executed immedi - ately after a dummy period has finished. if an interrupt request flag is set to  1  before entering the halt mode, the wake-up function of the related interrupt will be dis - abled. to minimize power consumption, all i/o pins should be carefully managed before entering the halt status. 4 : -   *        3   *      7   : -   *        4 :   : " *    3   *     :    3  ! 0 3  . 3      watchdog timer
HTG2150 rev. 1.30 15 may 21, 2002 reset there are three ways in which a reset can occur:  res reset during normal operation  res reset during halt  wdt time-out reset during normal operation the wdt time-out during halt is different from other chip reset conditions, since it can perform a  warm re - set  that just resets the pc and sp, leaving the other cir - cuits in their original state. some registers remain un - changed during other reset conditions. most registers are reset to the  initial condition  when the reset condi - tions are met. by examining the pd and to flags, the program can distinguish between different  chip resets  . to pd reset conditions 0 0 res reset during power-up u u res reset during normal operation 0 1 res wake-up halt 1 u wdt time-out during normal operation 1 1 wdt wake-up halt note:  u  means  unchanged  to guarantee that the system oscillator has started and stabilized, the sst (system start-up timer) provides an extra-delay of 1024 system clock pulses when the sys- tem powers up or awakes from the halt state. when a system power-up occurs, the sst delay is added during the reset period. but when the reset co- mes from the res pin, the sst delay is disabled. any wake-up from halt will enable the sst delay. the functional unit chip reset status are shown below. pc 000h interrupt disable prescaler clear wdt clear. after master reset, wdt begins counting timer (0/2/3) off lcd display enable pull-high of resb with input/output ports input mode sp points to the top of the stack timer 0 the timer 0 contains 16-bit programmable count-up counters and the clock source come from the system clock divided by 4. there are three registers related to timer counter 0; tmr0h (0ch), tmr0l (0dh), tmr0c (0eh). writing tmr0l only writes the data into a low byte buffer, and writing tmr0h will write the data and the contents of the low byte buffer into the timer 0 preload register (16-bit) simultaneously. the timer 0 preload register is changed by writing tmr0h operations and writing tmr0l will keep the timer 0 preload register unchanged. reading tmr0h will also latch the tmr0l into the low byte buffer to avoid the false timing problem. reading tmr0l returns the contents of the low byte buffer. in other words, the low byte of timer counter 0 cannot be read directly. it must read the tmr0h first to make the low byte contents of timer 0 be latched into the buffer. the tmr0c is the timer 0 control register, which defines the timer 0 options. the timer counter control registers define the operating mode, counting enable or disable and active edge. if the timer counter starts counting, it will count from the current contents in the timer counter to ffffh. once an overflow occurs, the counter is reloaded from the timer counter preload register and generates the correspond - ing interrupt request flag (t0f; bit of intc) at the same time. to enable the counting operation, the timer on bit (ton; bit 4 of tmr0c) should be set to 1. the overflow of the timer counter is one of the wake-up sources. no matter             *     :     &  * *      reset timing chart      reset circuit 3   5 # %  3       :             7       3    *       f   :   *             " ! :        7  *           " reset configuration
HTG2150 rev. 1.30 16 may 21, 2002 what the operation mode is, writin ga0to et0i can dis - able the corresponding interrupt service. in the case of timer counter off condition, writing data to the timer counter preload register will also reload that data to the timer counter. but if the timer counter is turned on, data written to the timer counter will only be kept in the timer counter preload register. the timer counter will still operate until overflow occurs. when the timer counter (reading tmr0h) is read, the clock will be blocked to avoid errors. as this may re - sults in a counting error, this must be taken into con - sideration by the programmer. the state of the registers is summarized in the following table: register reset (power on) wdt time-out (normal operation) res reset (normal operation) res reset (halt) wdt time-out (halt) tmr0h xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu tmr0l xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu tmr0c 00-0 1--- 00-0 1--- 00-0 1--- 00-0 1--- uu-u u--- tmr2 xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu tmr2c 00-0 1000 00-0 1000 00-0 1000 00-0 1000 uu-u uuuu tmr3 xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu tmr3c 00-0 1000 00-0 1000 00-0 1000 00-0 1000 uu-u uuuu intch 0000 0000 0000 0000 0000 0000 0000 0000 uuuu uuuu tbhp xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu program counter 0000h 0000h 0000h 0000h 0000h
mp0 xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu mp1 xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu acc xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu tblp xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu tblh xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu status --00 xxxx --1u uuuu --uu uuuu --01 uuuu --11 uuuu bp 0000 0000 0000 0000 0000 0000 0000 0000 uuuu uuuu lcdc 0100 0000 0100 0000 0100 0000 0100 0000 uuuu uuuu intc 0000 0000 0000 0000 0000 0000 0000 0000 uuuu uuuu wdts 0000 0111 0000 0111 0000 0111 0000 0111 uuuu uuuu pa 1111 1111 1111 1111 1111 1111 1111 1111 uuuu uuuu pac 1111 1111 1111 1111 1111 1111 1111 1111 uuuu uuuu pb 1111 0000 1111 0000 1111 0000 1111 0000 uuuu uuuu pbc 1111 0000 1111 0000 1111 0000 1111 0000 uuuu 0000 comr 0000 0000 0000 0000 0000 0000 0000 0000 uuuu uuuu pwmc 1111 1111 1111 1111 1111 1111 1111 1111 uuuu uuuu pwm xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu x talc 0000 0000 0000 0000 0000 0000 0000 0000 uuuu uuuu note:  *  means  warm reset   u  means  unchanged   x  means  unknown       *        * !   7    *                     * !     * 8     7     1   ' 7  f   *         %  f * 8 $   8  ' '    $      7   @  + timer counter 0
HTG2150 rev. 1.30 17 may 21, 2002 timer 2/3 timer 2 is an 8-bit counter, and its clock source comes from the system clock divided by an 8-stage prescaler. there are two registers related to time r 2 ; tmr2 (21h) and tmr2c (22h). two physical registers are mapped to tmr2 location; writing tmr2 makes the starting value be placed in the timer 2 preload register and reading the tmr2 gets the contents of the timer 2 coun - ter. the tmr2c is a control register, which defines the division ratio of the prescaler and counting enable or disable. writing data to b2, b1 and b0 (bits 2, 1, 0 of tmr2c) can yield various clock sources. once the timer 2 starts counting, it will count from the current contents in the counter to ffh. once an over- flow occurs, the counter is reloaded from a preload reg- ister, and generates an interrupt request flag (t2f; bit 4 of intch). to enable the counting operation, the timer on bit (ton; bit 4 of tmr2c) should be set to  1  . for proper operation, bit 6 of tmr2c should be set to  1  and bit 3, bit7 should be set to  0  . the timer 2 can also be used as pfd output by setting pwm1 and pwm2 to be pfd and pfdb output respec - tively by 2fh.7 and 2fh.6. when the pfd/pfdb func - tion is selected, setting 2fh.4/2fh.5 to  1  will enable the pfd/pfdb output and setting 2fh.4/2fh.5 to  0  will disable the pfd/pfdb output. pfd frequency: t2f/[256-tmr2)  2] timer 3 has the same structure and operating manner with timer 2, except for clock source and pfd function. the timer 3 can be used as a time base to generate a regular internal interrupt. the clock source of timer 3 can come from rtc osc (x tal 32khz) or system clock divided by an 8-stage prescaler. if the rtc mask option is enabled, a 32khz crystal is needed across xin and xout pins. the 32khz signal is processed by an 8-stage prescaler to yield various counting clock for timer 3. there are 2 registers related to timer 3; tmr3 (24h) and tmr3c (25h). writing data to b2, b1, b0 (bit 2, 1, 0 of tmr3c) can yield various counting clock. label bits function  0~2 unused bit, read as  0  . te 3 to define the tmr0 active edge of the timer counter (0=active on low to high; 1=active on high to low) ton 4 to enable/disable timer counting (0=disabled; 1=enabled)  5 unused bit, read as  x  . tm0, tm1 6, 7 0, 1=internal clock tmr0c register  )  *  % ( * 4 :           7        * .   7    *              * .     * 8     7     1   ' 7  f    . 2 5 g +   *          . '  . . 2 5 g / 3  . . 2 5 g 3   #  . 3  " . 2 5 g , 3   #  " timer 2 label bits function ssl 3~0 3~0 lcd common used pfd 4 to enable/disable pfd output (0=disable; 1=enable) pfdb 5 to enable/disable pfdb output (0=disable; 1=enable) pwm1 6 to select pfdb/pwm1 output (0=pwm1; 1=pfdb) pwm2 7 to select pfd/pwm2 output (0=pwm2; 1=pfd) 2fh register
HTG2150 rev. 1.30 18 may 21, 2002      *         7    4 *      *      7   %   *    1   ; / " . 5 6 = . ( *  b #  % . 5 g 4 *      *      7    $      7   @ 2 ! 2 "  '     * . , 4 5 6   , +    @ *      timer 3 tmr2c t2f bit 2 bit 1 bit 0 0 0 0 sys clk/2 0 0 1 sys clk/4 0 1 0 sys clk/8 0 1 1 sys clk/16 1 0 0 sys clk/32 1 0 1 sys clk/64 1 1 0 sys clk/128 1 1 1 sys clk/256 tmr2c bit 4 to enable/disable timer counting (0=dis - able;1=enable) tmr2c bit 3 always write  0  tmr2c bit 5 always write   tmr2c bit 6 always write  1  tmr2c bit 7 always write  0  f1 can select 4 frequency by mask option auto mask option f0 sys clk near 512khz sys clk/16 sys clk near 1024khz sys clk/32 sys clk near 2048khz sys clk/64 sys clk near 4096khz sys clk/128 tmr3c t3f bit 2 bit 1 bit 0 0 0 0 f1/2 0 0 1 f1/4 0 1 0 f1/8 0 1 1 f1/16 1 0 0 f1/32 1 0 1 f1/64 1 1 0 f1/128 1 1 1 f1/256 time base frequency= t3f / (256  tmr3) tmr3c bit 4 to enable/disable timer counting (0=dis- able; 1=enable) tmr3c bit 3 always write  0  tmr3c bit 5 always write  0  tmr3c bit 6 always write  1  tmr3c bit 7 always write  0  input/output ports there are 12 bidirectional input/output lines in the HTG2150, labeled pa and pb, which are mapped to the data memory of [12h], [14h], respectively. all these i/o ports can be used for input and output operations. for input operation, these ports are non-latching, that is, the inputs must be ready at the t2 rising edge of instruction h   (  h   (  h     #  # * 8   3     *       7 *          &  *          *       7 *         3     *        *     $     * 3  @  :  * ; # *   7 $ = 3 # (  7 7 :  # ! 0 # 8 + 0 8    @ *         @ *         h    input/output ports
HTG2150 rev. 1.30 19 may 21, 2002 mov a,[m] (m=12h, 14h). for output operation, all data is latched and remains unchanged until the output latch is rewritten. each i/o line has its own control register (pac, pbc) to control the input/output configuration. with this control register, cmos output or schmitt trigger input with or without pull-high resistor structures can be reconfigured dynamically under software control. to function as an in - put, the corresponding latch of the control register must write  1  . the pull-high resistance will exhibit automati - cally if the pull-high option is selected. the input source also depends on the control register. if the control regis - ter bit is  1  , the input will read the pad state. if the con - trol register bit is  0  , the contents of the latches will move to the internal bus. the latter is possible in  read-modify-write  instruction. for output function, cmos is the only configuration. these control registers are mapped to locations 13h, 15h. after a chip reset, these input/output lines stay at schmitt trigger input with pull-high resistor. each bit of these input/output latches can be set or cleared by the set [m].i or clr [m].i (m=12h, 14h) instruction. some instructions first input data and then follow the output operations. for example, the set [m].i, clr [m].i, cpl [m] and cpla [m] instructions read the entire port states into the cpu, execute the defined operations (bit-operation), and then write the results back to the latches or the accumulator. each line of port a has the capability to wake-up the de- vice. port b are share pad, each pin function are defined by mask option, the pb7 shares with seg36. the pb6, pb5 and pb4 share with seg35, seg34 and seg33. if the segment output is selected, the related i/o register (pb) cannot be used as general purpose register. reading the register will result to an unknown state. pwm interface the HTG2150 provides an 8 bit (bit 7 is a sign bit) pwm d/a interface, which is good for speech synthesis. the user can record or synthesize the sound and digitize it into the program rom. these sound could be played back in sequence of the functions as designed by the in - ternal program rom. there are several algorithms that can be used in the HTG2150, they are ... pcm,  law, dpcm, adpcm..... . the pwm circuit provides two pad outputs: pwm2, pwm1 which can directly drive a piezo or a 32  speaker without adding any external element. refer to the appli - cation circuits. the pwm clock source comes from the system clock di - vided by a 3-bit prescaler. setting data to p0, p1 and p2 (bit 3, 4, 5 of 27h) can yield various clock sources. the clock source are use for pwm modulating clock and sampling clock. after setting the start bit (bit 0 27h) and the next falling edge coming from the prescaler, the  div  will generate a serial clock to pwm counter for modulating and pwmi for interrupt. the pwm counter latch data at the first  f1  clock falling edge and the start counter at  f1  rising edge. the  f2  clock is synchro - nous with the first  f1  clock and it is also connected to the pwm output latch. in setting the  start bit  initial sta - tus, the  pwm1 dac  outputs a  high  level and change the output status to  low  while the  7 bits counter  overflows. bz/sp 6/7 bit f1 f2 (sampling rate device 0 0 f0 f0/64 32  speaker 0 1 f0 f0/128 32  speaker 1 0 f0 f0/64 buzzer/8  speaker 1 1 f0 f0/128 buzzer/8  speaker note: f1: for pwm modulation clock and f2 for sampling clock. f0: system /[n+1] n=0~7 (n:3 bits preload counter) on the above table, we can easily see that the sampling rate is dependent on the system clock. if start bit is set to  0  , the pwm2 and pwm1 will output a gnd level volt - age. label bits function d/a 0 d/a control. 0:start ; 1:stop bz/sp 1 output driver select 1:buzzer ; 0:speaker bit 2 pwm counter bit select 1:7 bits ; 0:6 bits p0~p2 3~5 3 bits preload counter, bit 5/4/3:000b~111b (0~7) bit 3:lsb d0, d1 6, 7 pwmi d0 d1 pwm interrupt 001 012 104 118 pwm control register bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 7 bit d0 d1 d2 d3 d4 d5 d6 d7 6 bit x d1d2d3d4d5d6d7 note: x means don t care. bit7: sign bit pwm data buffer
HTG2150 rev. 1.30 20 may 21, 2002 2 !      * -   2 " 2 .    *    7    *     " . 4 *  7   @ %    & 7 bits pwm counter bit  $     *  7   @      7   3  *     8  ' '   * ; . 4 5 = * 8    *            * 8    1   ' 7  f 3   #  " * '   * .  *  ( 2 !      * -   . 5 g !   1 g 3   2 .  ( 2 "      ( h  h 3   #  . * '   * .  *  ( 27h.1=0 speaker  $     *  7   @      7   3  *     8  ' '   * ; . 4 5 = * 8    *            * 8    1   ' 7  f 2 !      * -   . 5 g !   1 g 3   2 .  (     * -   2 " 3   #  " * '   * 8 i 3   #  . * '   * 8 i      ( h  h 27h.1=1 buzzer
HTG2150 rev. 1.30 21 may 21, 2002 mask option the following shows many kinds of mask options in the HTG2150. all the mask options must be defined on order to en - sure proper system functioning. no. mask option 1 wdt enable/disable selection. wdt can be enabled or disabled by mask option. 2 wake-up selection. this option defines the wake-up activity. external i/o pins (pa only) all have the capabil - ity to wake-up the chip from a halt mode by a following edge. 3 external interrupt input pin share with other function selection. int /seg37: int can be set as an external interrupt input pin or lcd segment output pin. 4 i/o pins share with other function selection. pb4/seg33, pb5/seg34, pb6/seg35, pb7/seg36: pb4, pb5, pb6, pb7 can be set as i/o pins or lcd segment output pins. 5 segment output pins share with other function selection. xin/seg39, xout/seg38: seg38, seg39 ban be set as lcd segment output pins or xin, xout pins be connected to a 32768hz crystal. 6 lcd bias register selection. this option describes the lcd bias current. there are three types of selection. *  selectable as small, middle or large current. note: * "      # $     % " " ! @   + *    " " ! @  " " ! @  "  + *    " " ! @ 
  .  + *    &       # $     % , ! @   + *    "  + *   
  .  + *       '   # $     % " ! @   + *    "  + *   
  .  + *    , ! @  , ! @  , ! @  " ! @  " ! @  " ! @          
application circuits note: * optional capacitors can be added to get a more accurate frequency. since each crystal has its own characteristics, the user should consult the crystal manufacturer for appropriate value of the external capacitors. ** r=100k  ,f sys =2mhz r=200k  ,f sys =1mhz HTG2150 rev. 1.30 22 may 21, 2002     # ! 0 # (           )  $ * *         #  %    +               #  %                 
   ! 0    
! 0 
9 ;   > g = "  + * 8    %   #  %     # ! 0 #              
"  + * 8    %   #  %       3  " 3  . 3  . 4 ! / ! 4   (    .    (   * 8  6 6       
9      
4 . , 4 5 6     
9      
4 . , 4 5 6      ! 0    
! 0 
9 ;   > g = j j , . @  ; '  )  d +  5 6 = ! g "  2 ! g "  2 j j , . @  ; '  )  d +  5 6 = ! g "  2
instruction set summary mnemonic description instruction cycle flag affected arithmetic add a,[m] addm a,[m] add a,x adc a,[m] adcm a,[m] sub a,x sub a,[m] subm a,[m] sbc a,[m] sbcm a,[m] daa [m] add data memory to acc add acc to data memory add immediate data to acc add data memory to acc with carry add acc to data memory with carry subtract immediate data from acc subtract data memory from acc subtract data memory from acc with result in data memory subtract data memory from acc with carry subtract data memory from acc with carry and result in data memory decimal adjust acc for addition with result in data memory 1 1 (1) 1 1 1 (1) 1 1 1 (1) 1 1 (1) 1 (1) z,c,ac,ov z,c,ac,ov z,c,ac,ov z,c,ac,ov z,c,ac,ov z,c,ac,ov z,c,ac,ov z,c,ac,ov z,c,ac,ov z,c,ac,ov c logic operation and a,[m] or a,[m] xor a,[m] andm a,[m] orm a,[m] xorm a,[m] and a,x or a,x xor a,x cpl [m] cpla [m] and data memory to acc or data memory to acc exclusive-or data memory to acc and acc to data memory or acc to data memory exclusive-or acc to data memory and immediate data to acc or immediate data to acc exclusive-or immediate data to acc complement data memory complement data memory with result in acc 1 1 1 1 (1) 1 (1) 1 (1) 1 1 1 1 (1) 1 z z z z z z z z z z z increment & decrement inca [m] inc [m] deca [m] dec [m] increment data memory with result in acc increment data memory decrement data memory with result in acc decrement data memory 1 1 (1) 1 1 (1) z z z z rotate rra [m] rr [m] rrca [m] rrc [m] rla [m] rl [m] rlca [m] rlc [m] rotate data memory right with result in acc rotate data memory right rotate data memory right through carry with result in acc rotate data memory right through carry rotate data memory left with result in acc rotate data memory left rotate data memory left through carry with result in acc rotate data memory left through carry 1 1 (1) 1 1 (1) 1 1 (1) 1 1 (1) none none c c none none c c data move mov a,[m] mov [m],a mov a,x move data memory to acc move acc to data memory move immediate data to acc 1 1 (1) 1 none none none bit operation clr [m].i set [m].i clear bit of data memory set bit of data memory 1 (1) 1 (1) none none HTG2150 rev. 1.30 23 may 21, 2002
mnemonic description instruction cycle flag affected branch jmp addr sz [m] sza [m] sz [m].i snz [m].i siz [m] sdz [m] siza [m] sdza [m] call addr ret ret a,x reti jump unconditionally skip if data memory is zero skip if data memory is zero with data movement to acc skip if bit i of data memory is zero skip if bit i of data memory is not zero skip if increment data memory is zero skip if decrement data memory is zero skip if increment data memory is zero with result in acc skip if decrement data memory is zero with result in acc subroutine call return from subroutine return from subroutine and load immediate data to acc return from interrupt 2 1 (2) 1 (2) 1 (2) 1 (2) 1 (3) 1 (3) 1 (2) 1 (2) 2 2 2 2 none none none none none none none none none none none none none table read tabrdc [m] tabrdl [m] read rom code (current page) to data memory and tblh read rom code (last page) to data memory and tblh 2 (1) 2 (1) none none miscellaneous nop clr [m] set [m] clr wdt clr wdt1 clr wdt2 swap [m] swapa [m] halt no operation clear data memory set data memory clear watchdog timer pre-clear watchdog timer pre-clear watchdog timer swap nibbles of data memory swap nibbles of data memory with result in acc enter power down mode 1 1 (1) 1 (1) 1 1 1 1 (1) 1 1 none none none to,pd to (4) ,pd (4) to (4) ,pd (4) none none to,pd note: x: immediate data m: data memory address a: accumulator i: 0~7 number of bits addr: program memory address : flag is affected  : flag is not affected (1) : if a loading to the pcl register occurs, the execution cycle of instructions will be delayed for one more cycle (four system clocks). (2) : if a skipping to the next instruction occurs, the execution cycle of instructions will be delayed for one more cycle (four system clocks). otherwise the original instruction cycle is unchanged. (3) : (1) and (2) (4) : the flags may be affected by the execution status. if the watchdog timer is cleared by executing the clr wdt1 or clr wdt2 instruction, the to and pd are cleared. otherwise the to and pd flags remain unchanged. HTG2150 rev. 1.30 24 may 21, 2002
instruction definition adc a,[m] add data memory and carry to the accumulator description the contents of the specified data memory, accumulator and the carry flag are added si - multaneously, leaving the result in the accumulator. operation acc acc+[m]+c affected flag(s) tc2 tc1 to pd ov z ac c  adcm a,[m] add the accumulator and carry to data memory description the contents of the specified data memory, accumulator and the carry flag are added si - multaneously, leaving the result in the specified data memory. operation [m] acc+[m]+c affected flag(s) tc2 tc1 to pd ov z ac c  add a,[m] add data memory to the accumulator description the contents of the specified data memory and the accumulator are added. the result is stored in the accumulator. operation acc acc+[m] affected flag(s) tc2 tc1 to pd ov z ac c  add a,x add immediate data to the accumulator description the contents of the accumulator and the specified data are added, leaving the result in the accumulator. operation acc acc+x affected flag(s) tc2 tc1 to pd ov z ac c  addm a,[m] add the accumulator to the data memory description the contents of the specified data memory and the accumulator are added. the result is stored in the data memory. operation [m] acc+[m] affected flag(s) tc2 tc1 to pd ov z ac c  HTG2150 rev. 1.30 25 may 21, 2002
and a,[m] logical and accumulator with data memory description data in the accumulator and the specified data memory perform a bitwise logical_and op - eration. the result is stored in the accumulator. operation acc acc  and  [m] affected flag(s) tc2 tc1 to pd ov z ac c   and a,x logical and immediate data to the accumulator description data in the accumulator and the specified data perform a bitwise logical_and operation. the result is stored in the accumulator. operation acc acc  and  x affected flag(s) tc2 tc1 to pd ov z ac c   andm a,[m] logical and data memory with the accumulator description data in the specified data memory and the accumulator perform a bitwise logical_and op - eration. the result is stored in the data memory. operation [m] acc  and  [m] affected flag(s) tc2 tc1 to pd ov z ac c   call addr subroutine call description the instruction unconditionally calls a subroutine located at the indicated address. the program counter increments once to obtain the address of the next instruction, and pushes this onto the stack. the indicated address is then loaded. program execution continues with the instruction at this address. operation stack pc+1 pc addr affected flag(s) tc2 tc1 to pd ov z ac c    clr [m] clear data memory description the contents of the specified data memory are cleared to 0. operation [m] 00h affected flag(s) tc2 tc1 to pd ov z ac c    HTG2150 rev. 1.30 26 may 21, 2002
clr [m].i clear bit of data memory description the bit i of the specified data memory is cleared to 0. operation [m].i 0 affected flag(s) tc2 tc1 to pd ov z ac c    clr wdt clear watchdog timer description the wdt is cleared (clears the wdt). the power down bit (pd) and time-out bit (to) are cleared. operation wdt 00h pd and to 0 affected flag(s) tc2 tc1 to pd ov z ac c  00  clr wdt1 preclear watchdog timer description together with clr wdt2, clears the wdt. pd and to are also cleared. only execution of this instruction without the other preclear instruction just sets the indicated flag which im - plies this instruction has been executed and the to and pd flags remain unchanged. operation wdt 00h* pd and to 0* affected flag(s) tc2 tc1 to pd ov z ac c  0* 0*  clr wdt2 preclear watchdog timer description together with clr wdt1, clears the wdt. pd and to are also cleared. only execution of this instruction without the other preclear instruction, sets the indicated flag which implies this instruction has been executed and the to and pd flags remain unchanged. operation wdt 00h* pd and to 0* affected flag(s) tc2 tc1 to pd ov z ac c  0* 0*  cpl [m] complement data memory description each bit of the specified data memory is logically complemented (1 s complement). bits which previously containe d a 1 are changed to 0 and vice-versa. operation [m] [m ] affected flag(s) tc2 tc1 to pd ov z ac c   HTG2150 rev. 1.30 27 may 21, 2002
cpla [m] complement data memory and place result in the accumulator description each bit of the specified data memory is logically complemented (1 s complement). bits which previously contained a 1 are changed to 0 and vice-versa. the complemented result is stored in the accumulator and the contents of the data memory remain unchanged. operation acc [m ] affected flag(s) tc2 tc1 to pd ov z ac c   daa [m] decimal-adjust accumulator for addition description the accumulator value is adjusted to the bcd (binary coded decimal) code. the accumu - lator is divided into two nibbles. each nibble is adjusted to the bcd code and an internal carry (ac1) will be done if the low nibble of the accumulator is greater than 9. the bcd ad - justment is done by adding 6 to the original value if the original value is greater than 9 or a carry (ac or c) is set; otherwise the original value remains unchanged. the result is stored in the data memory and only the carry flag (c) may be affected. operation if acc.3~acc.0 >9 or ac=1 then [m].3~[m].0 (acc.3~acc.0)+6, ac1=ac else [m].3~[m].0 (acc.3~acc.0), ac1=0 and if acc.7~acc.4+ac1 >9 or c=1 then [m].7~[m].4 acc.7~acc.4+6+ac1,c=1 else [m].7~[m].4 acc.7~acc.4+ac1,c=c affected flag(s) tc2 tc1 to pd ov z ac c    dec [m] decrement data memory description data in the specified data memory is decremented by 1. operation [m] [m]  1 affected flag(s) tc2 tc1 to pd ov z ac c   deca [m] decrement data memory and place result in the accumulator description data in the specified data memory is decremented by 1, leaving the result in the accumula - tor. the contents of the data memory remain unchanged. operation acc [m]  1 affected flag(s) tc2 tc1 to pd ov z ac c   HTG2150 rev. 1.30 28 may 21, 2002
halt enter power down mode description this instruction stops program execution and turns off the system clock. the contents of the ram and registers are retained. the wdt and prescaler are cleared. the power down bit (pd) is set and the wdt time-out bit (to) is cleared. operation pc pc+1 pd 1 to 0 affected flag(s) tc2 tc1 to pd ov z ac c  01  inc [m] increment data memory description data in the specified data memory is incremented by 1 operation [m] [m]+1 affected flag(s) tc2 tc1 to pd ov z ac c   inca [m] increment data memory and place result in the accumulator description data in the specified data memory is incremented by 1, leaving the result in the accumula - tor. the contents of the data memory remain unchanged. operation acc [m]+1 affected flag(s) tc2 tc1 to pd ov z ac c   jmp addr directly jump description the program counter are replaced with the directly-specified address unconditionally, and control is passed to this destination. operation pc addr affected flag(s) tc2 tc1 to pd ov z ac c    mov a,[m] move data memory to the accumulator description the contents of the specified data memory are copied to the accumulator. operation acc [m] affected flag(s) tc2 tc1 to pd ov z ac c    HTG2150 rev. 1.30 29 may 21, 2002
mov a,x move immediate data to the accumulator description the 8-bit data specified by the code is loaded into the accumulator. operation acc x affected flag(s) tc2 tc1 to pd ov z ac c    mov [m],a move the accumulator to data memory description the contents of the accumulator are copied to the specified data memory (one of the data memories). operation [m] acc affected flag(s) tc2 tc1 to pd ov z ac c    nop no operation description no operation is performed. execution continues with the next instruction. operation pc pc+1 affected flag(s) tc2 tc1 to pd ov z ac c    or a,[m] logical or accumulator with data memory description data in the accumulator and the specified data memory (one of the data memories) per- form a bitwise logical_or operation. the result is stored in the accumulator. operation acc acc  or  [m] affected flag(s) tc2 tc1 to pd ov z ac c   or a,x logical or immediate data to the accumulator description data in the accumulator and the specified data perform a bitwise logical_or operation. the result is stored in the accumulator. operation acc acc  or  x affected flag(s) tc2 tc1 to pd ov z ac c   orm a,[m] logical or data memory with the accumulator description data in the data memory (one of the data memories) and the accumulator perform a bitwise logical_or operation. the result is stored in the data memory. operation [m] acc  or  [m] affected flag(s) tc2 tc1 to pd ov z ac c   HTG2150 rev. 1.30 30 may 21, 2002
ret return from subroutine description the program counter is restored from the stack. this is a 2-cycle instruction. operation pc stack affected flag(s) tc2 tc1 to pd ov z ac c    ret a,x return and place immediate data in the accumulator description the program counter is restored from the stack and the accumulator loaded with the speci - fied 8-bit immediate data. operation pc stack acc x affected flag(s) tc2 tc1 to pd ov z ac c    reti return from interrupt description the program counter is restored from the stack, and interrupts are enabled by setting the emi bit. emi is the enable master (global) interrupt bit. operation pc stack emi 1 affected flag(s) tc2 tc1 to pd ov z ac c    rl [m] rotate data memory left description the contents of the specified data memory are rotated 1 bit left with bit 7 rotated into bit 0. operation [m].(i+1) [m].i; [m].i:bit i of the data memory (i=0~6) [m].0 [m].7 affected flag(s) tc2 tc1 to pd ov z ac c    rla [m] rotate data memory left and place result in the accumulator description data in the specified data memory is rotated 1 bit left with bit 7 rotated into bit 0, leaving the rotated result in the accumulator. the contents of the data memory remain unchanged. operation acc.(i+1) [m].i; [m].i:bit i of the data memory (i=0~6) acc.0 [m].7 affected flag(s) tc2 tc1 to pd ov z ac c    HTG2150 rev. 1.30 31 may 21, 2002
rlc [m] rotate data memory left through carry description the contents of the specified data memory and the carry flag are rotated 1 bit left. bit 7 re - places the carry bit; the original carry flag is rotated into the bit 0 position. operation [m].(i+1) [m].i; [m].i:bit i of the data memory (i=0~6) [m].0 c c [m].7 affected flag(s) tc2 tc1 to pd ov z ac c    rlca [m] rotate left through carry and place result in the accumulator description data in the specified data memory and the carry flag are rotated 1 bit left. bit 7 replaces the carry bit and the original carry flag is rotated into bit 0 position. the rotated result is stored in the accumulator but the contents of the data memory remain unchanged. operation acc.(i+1) [m].i; [m].i:bit i of the data memory (i=0~6) acc.0 c c [m].7 affected flag(s) tc2 tc1 to pd ov z ac c    rr [m] rotate data memory right description the contents of the specified data memory are rotated 1 bit right with bit 0 rotated to bit 7. operation [m].i [m].(i+1); [m].i:bit i of the data memory (i=0~6) [m].7 [m].0 affected flag(s) tc2 tc1 to pd ov z ac c    rra [m] rotate right and place result in the accumulator description data in the specified data memory is rotated 1 bit right with bit 0 rotated into bit 7, leaving the rotated result in the accumulator. the contents of the data memory remain unchanged. operation acc.(i) [m].(i+1); [m].i:bit i of the data memory (i=0~6) acc.7 [m].0 affected flag(s) tc2 tc1 to pd ov z ac c    rrc [m] rotate data memory right through carry description the contents of the specified data memory and the carry flag are together rotated 1 bit right. bit 0 replaces the carry bit; the original carry flag is rotated into the bit 7 position. operation [m].i [m].(i+1); [m].i:bit i of the data memory (i=0~6) [m].7 c c [m].0 affected flag(s) tc2 tc1 to pd ov z ac c    HTG2150 rev. 1.30 32 may 21, 2002
rrca [m] rotate right through carry and place result in the accumulator description data of the specified data memory and the carry flag are rotated 1 bit right. bit 0 replaces the carry bit and the original carry flag is rotated into the bit 7 position. the rotated result is stored in the accumulator. the contents of the data memory remain unchanged. operation acc.i [m].(i+1); [m].i:bit i of the data memory (i=0~6) acc.7 c c [m].0 affected flag(s) tc2 tc1 to pd ov z ac c    sbc a,[m] subtract data memory and carry from the accumulator description the contents of the specified data memory and the complement of the carry flag are sub - tracted from the accumulator, leaving the result in the accumulator. operation acc acc+[m ]+c affected flag(s) tc2 tc1 to pd ov z ac c  sbcm a,[m] subtract data memory and carry from the accumulator description the contents of the specified data memory and the complement of the carry flag are sub - tracted from the accumulator, leaving the result in the data memory. operation [m] acc+[m ]+c affected flag(s) tc2 tc1 to pd ov z ac c  sdz [m] skip if decrement data memory is 0 description the contents of the specified data memory are decremented by 1. if the result is 0, the next instruction is skipped. if the result is 0, the following instruction, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper instruc - tion (2 cycles). otherwise proceed with the next instruction (1 cycle). operation skip if ([m]  1)=0, [m] ([m]  1) affected flag(s) tc2 tc1 to pd ov z ac c    sdza [m] decrement data memory and place result in acc, skip if 0 description the contents of the specified data memory are decremented by 1. if the result is 0, the next instruction is skipped. the result is stored in the accumulator but the data memory remains unchanged. if the result is 0, the following instruction, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper instruction (2 cy - cles). otherwise proceed with the next instruction (1 cycle). operation skip if ([m]  1)=0, acc ([m]  1) affected flag(s) tc2 tc1 to pd ov z ac c    HTG2150 rev. 1.30 33 may 21, 2002
set [m] set data memory description each bit of the specified data memory is set to 1. operation [m] ffh affected flag(s) tc2 tc1 to pd ov z ac c    set [m]. i set bit of data memory description bit i of the specified data memory is set to 1. operation [m].i 1 affected flag(s) tc2 tc1 to pd ov z ac c    siz [m] skip if increment data memory is 0 description the contents of the specified data memory are incremented by 1. if the result is 0, the fol - lowing instruction, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper instruction (2 cycles). otherwise proceed with the next instruction (1 cycle). operation skip if ([m]+1)=0, [m] ([m]+1) affected flag(s) tc2 tc1 to pd ov z ac c    siza [m] increment data memory and place result in acc, skip if 0 description the contents of the specified data memory are incremented by 1. if the result is 0, the next instruction is skipped and the result is stored in the accumulator. the data memory re- mains unchanged. if the result is 0, the following instruction, fetched during the current in- struction execution, is discarded and a dummy cycle is replaced to get the proper instruction (2 cycles). otherwise proceed with the next instruction (1 cycle). operation skip if ([m]+1)=0, acc ([m]+1) affected flag(s) tc2 tc1 to pd ov z ac c    snz [m].i skip if bit i of the data memory is not 0 description if bit i of the specified data memory is not 0, the next instruction is skipped. if bit i of the data memory is not 0, the following instruction, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper instruction (2 cycles). other - wise proceed with the next instruction (1 cycle). operation skip if [m].i  0 affected flag(s) tc2 tc1 to pd ov z ac c    HTG2150 rev. 1.30 34 may 21, 2002
sub a,[m] subtract data memory from the accumulator description the specified data memory is subtracted from the contents of the accumulator, leaving the result in the accumulator. operation acc acc+[m ]+1 affected flag(s) tc2 tc1 to pd ov z ac c  subm a,[m] subtract data memory from the accumulator description the specified data memory is subtracted from the contents of the accumulator, leaving the result in the data memory. operation [m] acc+[m ]+1 affected flag(s) tc2 tc1 to pd ov z ac c  sub a,x subtract immediate data from the accumulator description the immediate data specified by the code is subtracted from the contents of the accumula - tor, leaving the result in the accumulator. operation acc acc+x +1 affected flag(s) tc2 tc1 to pd ov z ac c  swap [m] swap nibbles within the data memory description the low-order and high-order nibbles of the specified data memory (1 of the data memo- ries) are interchanged. operation [m].3~[m].0  [m].7~[m].4 affected flag(s) tc2 tc1 to pd ov z ac c    swapa [m] swap data memory and place result in the accumulator description the low-order and high-order nibbles of the specified data memory are interchanged, writ - ing the result to the accumulator. the contents of the data memory remain unchanged. operation acc.3~acc.0 [m].7~[m].4 acc.7~acc.4 [m].3~[m].0 affected flag(s) tc2 tc1 to pd ov z ac c    HTG2150 rev. 1.30 35 may 21, 2002
sz [m] skip if data memory is 0 description if the contents of the specified data memory are 0, the following instruction, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper instruction (2 cycles). otherwise proceed with the next instruction (1 cycle). operation skip if [m]=0 affected flag(s) tc2 tc1 to pd ov z ac c    sza [m] move data memory to acc, skip if 0 description the contents of the specified data memory are copied to the accumulator. if the contents is 0, the following instruction, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper instruction (2 cycles). otherwise proceed with the next instruction (1 cycle). operation skip if [m]=0 affected flag(s) tc2 tc1 to pd ov z ac c    sz [m].i skip if bit i of the data memory is 0 description if bit i of the specified data memory is 0, the following instruction, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper instruc - tion (2 cycles). otherwise proceed with the next instruction (1 cycle). operation skip if [m].i=0 affected flag(s) tc2 tc1 to pd ov z ac c    tabrdc [m] move the rom code (current page) to tblh and data memory description the low byte of rom code (current page) addressed by the table pointer (tblp) is moved to the specified data memory and the high byte transferred to tblh directly. operation [m] rom code (low byte) tblh rom code (high byte) affected flag(s) tc2 tc1 to pd ov z ac c    tabrdl [m] move the rom code (last page) to tblh and data memory description the low byte of rom code (last page) addressed by the table pointer (tblp) is moved to the data memory and the high byte transferred to tblh directly. operation [m] rom code (low byte) tblh  code (high byte) affected flag(s) tc2 tc1 to pd ov z ac c    HTG2150 rev. 1.30 36 may 21, 2002
xor a,[m] logical xor accumulator with data memory description data in the accumulator and the indicated data memory perform a bitwise logical exclu - sive_or operation and the result is stored in the accumulator. operation acc acc  xor  [m] affected flag(s) tc2 tc1 to pd ov z ac c   xorm a,[m] logical xor data memory with the accumulator description data in the indicated data memory and the accumulator perform a bitwise logical exclu - sive_or operation. the result is stored in the data memory. the 0 flag is affected. operation [m] acc  xor  [m] affected flag(s) tc2 tc1 to pd ov z ac c   xor a,x logical xor immediate data to the accumulator description data in the accumulator and the specified data perform a bitwise logical exclusive_or op - eration. the result is stored in the accumulator. the 0 flag is affected. operation acc acc  xor  x affected flag(s) tc2 tc1 to pd ov z ac c   HTG2150 rev. 1.30 37 may 21, 2002
HTG2150 rev. 1.30 38 may 21, 2002 copyright  200 2 by holtek semiconductor inc. the information appearing in this data sheet is believed to be accurate at the time of publication. however, holtek as - sumes no responsibility arising from the use of the specifications described. the applications mentioned herein are used solely for the purpose of illustration and holtek makes no warranty or representation that such applications will be suitable without further modification, nor recommends the use of its products for application that may present a risk to human life due to malfunction or otherwise. holtek  s products are not authorized for use as critical components in life support devices or systems. holtek reserves the right to alter its products without prior notification. for the most up-to-date information, please visit our web site at http://www.holtek.com.tw. holtek semiconductor inc. (headquarters) no.3, creation rd. ii, science park, hsinchu, taiwan tel: 886-3-563-1999 fax: 886-3-563-1189 http://www.holtek.com.tw holtek semiconductor inc. (taipei sales office) 4f-2, no. 3-2, yuanqu st., nankang software park, taipei 115, taiwan tel: 886-2-2655-7070 fax: 886-2-2655-7373 fax: 886-2-2655-7383 (international sales hotline) holtek semiconductor inc. (shanghai sales office) 7th floor, building 2, no.889, yi shan rd., shanghai, china 200233 tel: 021-6485-5560 fax: 021-6485-0313 http://www.holtek.com.cn holtek semiconductor inc. (shenzhen sales office) 5/f, unit a, productivity building, cross of science m 3rd road and gaoxin m 2nd road, science park, nanshan district, shenzhen, china 518057 tel: 0755-8616-9908, 8616-9308 fax: 0755-8616-9533 holtek semiconductor inc. (beijing sales office) suite 1721, jinyu tower, a129 west xuan wu men street, xicheng district, beijing, china 100031 tel: 010-6641-0030, 6641-7751, 6641-7752 fax: 010-6641-0125 holtek semiconductor inc. (chengdu sales office) 709, building 3, champagne plaza, no.97 dongda street, chengdu, sichuan, china 610016 tel: 028-6653-6590 fax: 028-6653-6591 holmate semiconductor, inc. (north america sales office) 46729 fremont blvd., fremont, ca 94538 tel: 510-252-9880 fax: 510-252-9885 http://www.holmate.com


▲Up To Search▲   

 
Price & Availability of HTG2150

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X